package com.example.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.KHMS;
import com.example.entity.Operate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tyhxzy
 * @since 2023-11-03
 */
public interface OperateMapper extends BaseMapper<Operate> {
    @Select("select * from operate where zid=#{id}")
    Operate findCompany(Integer id);

    Operate findByIdOperate(Integer id);


    @Insert("insert into operate(doorhead,contacts,name,address,info) values ()")
    int add(KHMS khms);


    //添加运营信息
    @Insert("insert into operate (zid) values (#{zid})")
    int InsertZid(Integer zid);


    @Update("update operate set doorhead=#{doorhead} where zid=#{zid}")
    int updateImg(Operate operate);


    @Update("update operate set name=#{name},status=#{status},info=#{info},afterhours=#{afterhours},beforehours=#{beforehours},type=#{type},contacts=#{contacts},phone=#{phone},address=#{address} where zid=#{zid}")
    int updateOperate(Operate operate);
    @Select("SELECT front FROM business WHERE zid=#{zid}")
    String findDoor(Integer id);
}
